USE [ERP]
GO

/****** Object:  Table [dbo].[EmployeeCertifications]    Script Date: 11/16/2009 14:30:47 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EmployeeCertifications](
	[EmployeeID] [nvarchar](50) NOT NULL,
	[CertificationName] [nvarchar](50) NULL,
	[CertificationTypeID] [nvarchar](50) NULL,
	[AverageScoreID] [nvarchar](50) NULL,
	[Institute] [nvarchar](50) NULL,
	[CertificationDate] [datetime] NOT NULL,
	[SpecialityField] [nvarchar](50) NULL,
	[Notes] [nvarchar](50) NULL,
 CONSTRAINT [PK_EmployeeCertifications] PRIMARY KEY CLUSTERED 
(
	[EmployeeID] ASC,
	[CertificationDate] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[EmployeeCertifications]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeCertifications_CertificationTypes] FOREIGN KEY([CertificationTypeID])
REFERENCES [dbo].[CertificationTypes] ([ID])
GO

ALTER TABLE [dbo].[EmployeeCertifications] CHECK CONSTRAINT [FK_EmployeeCertifications_CertificationTypes]
GO

ALTER TABLE [dbo].[EmployeeCertifications]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeCertifications_Employees] FOREIGN KEY([EmployeeID])
REFERENCES [dbo].[Employees] ([ID])
GO

ALTER TABLE [dbo].[EmployeeCertifications] CHECK CONSTRAINT [FK_EmployeeCertifications_Employees]
GO

ALTER TABLE [dbo].[EmployeeCertifications]  WITH CHECK ADD  CONSTRAINT [FK_EmployeeCertifications_Scores] FOREIGN KEY([AverageScoreID])
REFERENCES [dbo].[Scores] ([ID])
GO

ALTER TABLE [dbo].[EmployeeCertifications] CHECK CONSTRAINT [FK_EmployeeCertifications_Scores]
GO

